
package CSS::Preprocessor::Value::Template;

use base qw(CSS::Preprocessor::Value);
use strict;
use warnings;
use constant FIELDS => [qw(
    arg_names
    arg_scope
    block
)
];
use fields @{&FIELDS};

use Carp;

sub new {
    my ($class, %args) = @_;

    my $self = $class->SUPER::new();

    foreach my $k (@{&FIELDS}) {
        $self->{$k} = delete $args{$k};
    }

    croak "Unrecognised arguments ".join(',',keys %args) if %args;

    return $self;
}

sub _as_string_inner {
    my $self = shift;

    return "template (".join(', ', map({'$'.$_} @{$self->{arg_names}})).") ".$self->{block};
}

=head1 NAME

CSS::Preprocessor::Value::Template - Class representing a template value

=cut

1;

